﻿using System;
using System.ComponentModel.Composition;

namespace Peter.Common
{
   /// <summary>
   /// Metadata for a peter plugin.
   /// </summary>
   [MetadataAttribute]
   [AttributeUsage (AttributeTargets.Class, AllowMultiple = false)]
   public class PeterMetadataAttribute : ExportAttribute, IPeterMetadata
   {
      /// <summary>
      /// Initializes a new peter metadata attribute object.
      /// </summary>
      /// <param name="name">Name of the plugin.</param>
      /// <param name="author">Author of the plugin.</param>
      /// <param name="description">Description of the plugin.</param>
      /// <param name="version">Version of the plugin.</param>
      public PeterMetadataAttribute (string name, string author, string description, string version)
         : base (typeof (IPeterMetadata))
      {
         this.Name = name;
         this.Author = author;
         this.Description = description;
         this.Version = version;
      }

      /// <summary>
      /// Gets the name of the plugin.
      /// </summary>
      public string Name { get; private set; }

      /// <summary>
      /// Gets the author of the plugin.
      /// </summary>
      public string Author { get; private set; }

      /// <summary>
      /// Gets the description of the plugin.
      /// </summary>
      public string Description { get; private set; }

      /// <summary>
      /// Gets the version of the plugin.
      /// </summary>
      public string Version { get; private set; }
   }
}
